<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%@ taglib
	uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="">
<base href="<%=basePath%>">
<title>延期</title>
<link rel="stylesheet"
	href="https://cdn.bootcss.com/weui/1.1.3/style/weui.min.css">
<link rel="stylesheet"
	href="https://cdn.bootcss.com/jquery-weui/1.2.1/css/jquery-weui.min.css">
<link rel="stylesheet" type="text/css" href="resourse/css/demos.css">
</head>
<body>
	<div class="weui-cells weui-cells_form">
		<div class="weui-cell">
			<div class="weui-cell__hd">
				<input type="hidden" value="${proID}" id="proId" /> <input
					type="hidden" value="${infId}" id="infId" /> <input
					type="hidden" value="${oldDate}" id="oldDate" /> <label
					class="weui-label">延期原因：</label>
			</div>
			<div class="weui-cell__bd">
				<textarea id="taskinfo" class="weui-textarea" placeholder="请输入文本"
					rows="3"></textarea>
				<div class="weui-textarea-counter">
					<span>0</span>/200
				</div>
			</div>
		</div>
		<div class="weui-cells weui-cells_form">
			<div class="weui-cell">
				<div class="weui-cell__hd">
					<span>延期时间：</span>
				</div>
				<div class="weui-cell__bd">
					<input class="weui-input" type="date" id="datePlan">
				</div>
			</div>
		</div>
	</div>
	<div style="text-align: center;">
		<a href="javascript:saveDelay();"
			class="weui-btn weui-btn_mini weui-btn_primary">提交</a>
	</div>
	<!-- body 最后 -->
	<script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
	<script
		src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/jquery-weui.min.js"></script>
	<script>
		function saveDelay() {
			if ($('#taskinfo').val() == '') {
				$.toast('请填写延期原因', 'text');
				return;
			}
			if ($('#datePlan').val() == '' || $('#datePlan').val() == null) {
				$.toast('请选择计划完成日期', 'text');
				return;
			}
			$.showLoading();
			$.confirm({
				title : '',
				text : '确认提交？',
				onOK : function() {
					//点击确认
					$.ajax({
						type : "post",
						url : "task/saveProjectresultDelay",
						data : {
							inf_id : $('#infId').val(),
							content : $('#taskinfo').val(),
							planDateNew : $('#datePlan').val(),
							planDateOld : $('#oldDate').val(),
							proId : $('#proId').val()
						},
						success : function(data) {
							$.hideLoading();
							$.toast("操作成功");
						},
						error : function(XMLHttpRequest, textStatus,
								errorThrown) {
							$.messager.alert('消息', errorThrown);
						}
					});
				},
				onCancel : function() {
				}
			})
		}
	</script>
</body>
</html>